<?php

/**
 * TODO: describe class 'swzz_Supplier'
 *
 * @package swzz
 */
class swzz_Supplier
{

    // ---- PROPERTIES ----

    /**
     * TODO: describe property 'supplierId'
     *
     * @var 
     *
     * @orm 
     */
    public $supplierId;

    /**
     * TODO: describe property 'supplierName'
     *
     * @var 
     *
     * @orm 
     */
    public $supplierName;

    /**
     * TODO: describe property 'addresss'
     *
     * @var array of swzz_Address
     *
     * @orm composed_of many swzz_Address inverse(supplier)
     */
    public $addresss;

    /**
     * TODO: describe property 'deals'
     *
     * @var array of swzz_Deal
     *
     * @orm has many swzz_Deal inverse(supplier)
     */
    public $deals;

    /**
     * TODO: describe property 'product'
     *
     * @var swzz_Product
     *
     * @orm has one swzz_Product inverse(supplier)
     */
    public $product;

    // ---- METHODS ----

    /**
     * TODO: describe method '__construct'
     *
     * @param  $supplierName 
     */
    public function __construct($supplierName) {
        $this->setSupplierName($supplierName);
    }

    /**
     * TODO: describe method 'getSupplierId'
     *
     */
    public function getSupplierId() {
        return $this->supplierId;
    }

    /**
     * TODO: describe method 'setSupplierId'
     *
     * @param  $supplierId 
     */
    public function setSupplierId($supplierId) {
        $this->supplierId = $supplierId;
    }

    /**
     * TODO: describe method 'getSupplierName'
     *
     */
    public function getSupplierName() {
        return $this->supplierName;
    }

    /**
     * TODO: describe method 'setSupplierName'
     *
     * @param  $supplierName 
     */
    public function setSupplierName($supplierName) {
        $this->supplierName = $supplierName;
    }

    /**
     * TODO: describe method 'getAddresss'
     *
     * @return array 
     */
    public function getAddresss() {
        return $this->addresss;
    }

    /**
     * TODO: describe method 'setAddresss'
     *
     * @param array $addresss 
     */
    public function setAddresss(array $addresss) {
        $this->addresss = $addresss;
    }

    /**
     * TODO: describe method 'getDeals'
     *
     * @return array 
     */
    public function getDeals() {
        return $this->deals;
    }

    /**
     * TODO: describe method 'setDeals'
     *
     * @param array $deals 
     */
    public function setDeals(array $deals) {
        $this->deals = $deals;
    }

    /**
     * TODO: describe method 'getProduct'
     *
     * @return swzz_Product 
     */
    public function getProduct() {
        return $this->product;
    }

    /**
     * TODO: describe method 'setProduct'
     *
     * @param swzz_Product $product 
     */
    public function setProduct(swzz_Product $product) {
        $this->product = $product;
    }

    /**
     * TODO: describe method 'addAddress'
     *
     * @param swzz_Address $address 
     */
    public function addAddress(swzz_Address $address) {
        $this->addresss[] = $address;
    }

    /**
     * TODO: describe method 'removeAddress'
     *
     * @param swzz_Address $address 
     */
    public function removeAddress(swzz_Address $address) {
        $key = array_search($address, $this->addresss, true);

        if ($key !== false) {
            unset($this->addresss[$key]);
        }
    }

    /**
     * TODO: describe method 'addDeal'
     *
     * @param swzz_Deal $deal 
     */
    public function addDeal(swzz_Deal $deal) {
        $this->deals[] = $deal;
    }

    /**
     * TODO: describe method 'removeDeal'
     *
     * @param swzz_Deal $deal 
     */
    public function removeDeal(swzz_Deal $deal) {
        $key = array_search($deal, $this->deals, true);

        if ($key !== false) {
            unset($this->deals[$key]);
        }
    }

} // end of class swzz_Supplier

?>